home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / thor / sendcommand.thor < prev    next >
Text File  |  1996-11-10  |  2KB  |  71 lines

  1. /* SendCommand.thor · by Petter Nilsen and Troels Walsted Hansen
  2. ** $VER: SendCommand.thor v1.0 (21.04.94)
  3. **
  4. ** An ARexx script that will let you send a Script Command to several
  5. ** BBSes, based on a list or on interactive selection.
  6. */
  7.  
  8. options results
  9.  
  10. if(substr(address(),1,4) ~= "THOR") then do
  11.     parse arg portname
  12.     if~(show(p, portname)) then do
  13.         if ~(show(p, "THOR.01")) then do
  14.             say "No THOR port found!"
  15.             exit
  16.         end
  17.         else portname = "THOR.01"
  18.     end
  19. end
  20. else portname = address()
  21.  
  22. address(portname)
  23.  
  24. /* main stuff */
  25.  
  26. THORTOFRONT
  27. REQUESTSTRING TITLE '"Please enter script command:"' BT '"_Ok|_Cancel"' MAXCHARS 50
  28.  
  29. command = result
  30.  
  31. REQUESTNOTIFY TEXT '"Do you wish to send command to BBSes from a list?"' BT '"_Yes|_No"'
  32.  
  33. if(result = 0) then do
  34.     do forever
  35.         REQUESTLIST BBSLIST
  36.         bbsname = result
  37.         if(rc ~= 0|bbsname = "") then break
  38.  
  39.         ADDEVENT BBS '"'bbsname'"' EVENT DOCOMMAND CMD '"'command'"'
  40.         if(rc ~= 0) then REQUESTNOTIFY TEXT '"Failed to do command this time, try again?"' BT '"_Yes|_No"'
  41.         if(result = 0) then break
  42.  
  43.     end
  44. end
  45.  
  46. else if(result = 1) then do
  47.     REQUESTFILE TITLE '"Select Cross Command mailing list:"' ID '"THOR:Rexx/PostingLists"' FP
  48.     configfile = result
  49.  
  50.     lastchar = right(configfile,1)
  51.     if(rc~=0|lastchar = "/"|lastchar = ":"|configfile = "") then exit
  52.  
  53.     open(cf, configfile, R)
  54.  
  55.     do forever
  56.         call readln(cf)
  57.         bbsname = substr(readln(cf),6)
  58.         call readln(cf)
  59.  
  60.         if(bbsname = "") then break
  61.  
  62.         ADDEVENT BBS '"'bbsname'"' EVENT DOCOMMAND CMD '"'command'"'
  63.         if(rc ~= 0) then REQUESTNOTIFY TEXT '"Failed to do command this time, try again?"' BT '"_Yes|_No"'
  64.         if(result = 0) then break
  65.     end
  66.  
  67.     close(cf)
  68. end
  69.  
  70. exit
  71.